import api from "@/api";
export default {
  namespaced: true, //模块
  state() {
    return {
      orderList: {},
    };
  },
  getters: {},
  mutations: {
    getOrderlist(state, payload) {
      state.orderList = payload;
    },
  },
  actions: {
    async getOrderlist({ commit }) {
      //发起请求并将数据传递给getMenuTree中的payload
      try {
        let { data } = await api.order_list();
        commit("getOrderlist", data);
      } catch (err) {
        console.log(err);
      }
    },
  },
};
